<template>
	<view class="container">
		<view class="tit">
			<text>入账金额</text>
			<text class="money">￥{{money}}</text>
		</view>

		<view class="list">
			<view class="list_item">
				<text class="left">类型：</text>
				<text class="right">{{type}}</text>
			</view>
			<view class="list_item">
				<text class="left">时间：</text>
				<text class="right">{{date}}</text>
			</view>
			<view class="list_item">
				<text class="left">交易单号：</text>
				<text class="right">{{order_sn}}</text>
			</view>
			<view class="list_item">
				<text class="left">剩余零钱：</text>
				<text class="right">￥{{after}}</text>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		settleDetail
	} from '../../../api/api.js'
	export default {
		data() {
			return {
				// key: value
				id: '',
				type: '',
				date: '',
				order_sn: '',
				money: '',
				after :''
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getInfo()
		},
		methods: {
			getInfo() {
				settleDetail({
					id: this.id
				}).then(res => {
					console.log(res)
					this.type = res.data.type_text
					this.date = res.data.createtime_text
					this.order_sn = res.data.order_sn
					this.money = res.data.money
					this.after = res.data.after
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		width: 100%;
		height: calc(100% - 30upx);
		background-color: #f6f6f6;
		padding-top: 30upx;
	}

	.tit {
		width: calc(100% - 60upx);
		height: 100upx;
		font-size: 32upx;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 1upx solid #e9e6e9;
		padding: 0 30upx;

		.money {
			color: #fb817f;
		}
	}

	.list {
		width: 100%;
		background-color: #FFFFFF;
		padding: 50upx 0;

		.list_item {
			font-size: 28upx;
			color: #333;
			width: calc(100% - 60upx);
			height: 60upx;
			margin: 0 auto;

			.right {
				color: #999999;
				margin-left: 5upx;
			}
		}
	}
</style>
